package com.ganbo.pattern.builder;

/**
 * 定义ComputerBuild接口的具体实现,实现构建方法和装配电脑的各个组件
 *
 * @Author: ganbo
 * @Date: 2020/6/9 11:55
 */
public class ComputerConcreteBuilder implements ComputerBuilder {

    private Computer computer = new Computer();

    public ComputerBuilder buildCpu(String cpu) {
        computer.setCpu(cpu);
        return this;
    }

    public ComputerBuilder buildMemory(String memory) {
        computer.setMemory(memory);
        return this;
    }

    public ComputerBuilder buildDisk(String disk) {
        computer.setDisk(disk);
        return this;
    }

    public Computer build() {
        return computer;
    }
}
